<style scoped lang="less">
.app_page {
  position: relative;
  box-sizing: border-box;
  padding:20px;
  height: 100%;
  overflow: auto;
  padding-top:0 ;
  // background: #f2f3f5;
  .app_header {
    background-color: #fff;
     margin-bottom: 2vh;
     border-radius: 8px;
    //  padding-left: 1vh;
    //  height: 4.9vh;
    //  line-height: 4.9vh;
   
  }
  .app_main {
    
  }
}
a {
    color: #000;
    text-decoraction: none;
    margin-right: 2vh;
      padding: 2vh 2vh;
}
.router-link-active {
    text-decoration: none;
}
.link_tabActive{
  color: #1492FF;
   padding: 2vh 2vh;
   font-weight: bold;
  border-bottom: 3px solid #1492FF;
}
.tab_box{
   overflow: hidden;
}
.tab_items{
  float: left;
  height: 100%;
  font-size: 1.8vh;
padding: 2vh 2vh;
margin-left: 1vh;
cursor: pointer;
}
.tab_items.active{
    font-weight: bold;
     color: #1492FF;
  border-bottom: 3px solid #1492FF;
}
// .router-link-active{
//    color: #1492FF;
//    padding: 2vh 2vh;
//    font-weight: bold;
//   border-bottom: 3px solid #1492FF;
// }
</style>
<template>
  <div class="app_page h_100">
    <div class="app_header w_100" v-if="showMenuTab">
       <ul class="tab_box">
         <li class="tab_items"></li>
         <!-- <li class="tab_items">工作体系</li>
         <li class="tab_items">政策体系</li>
          <li class="tab_items">评价体系</li> -->
       </ul>
      <!-- <router-link to="/index" replace>指标体系</router-link>
        <router-link to="/gztx" replace>工作体系</router-link>
        <router-link to="/zctx" replace>政策体系</router-link>
         <router-link to="/pjtx" replace>评价体系</router-link> -->
    </div>
    <div class="app_main h_100">
        <router-view ></router-view>
    
    </div>
  </div>
</template>
<script>
export default {
  name: "mainPage",
  data() {
    return {
      showMenuTab:false,
      linkIndex:0,
      tabDatas:[{name:"指标体系",url:"/index"},{name:"工作体系",url:"/gztx"},{name:"政策体系",url:"/zctx"},{name:"评价体系",url:"/pjtx"}]
    };
  },
  computed: {
    value1: {
      get() {
        return this.$store.state.selectedIdentity;
      },
      set(value) {
        this.$store.commit("setSelectedIdentity", value);
      },
    },
  },
  methods: {
    init(){
      //  const isZzd = JSON.stringify(navigator.userAgent).indexOf('TaurusApp') > -1;
      //   if (isZzd) {
      //       //返回结果为false则为非政务钉钉/浙政钉2.0环境，需要展示图1-1交互页面
      //       window.location.href = "https://dgov-integrate.jinhua.gov.cn:5443/szjh-gov-pc/#/404"
      //   }else{
      //      this.getW_wd()
      //   }
    },
 getUrlData() {
      //获取页面URL参数
      let tempStr = window.location.href;
      let tempArr = tempStr.split("?")[1]
        ? tempStr.split("?")[1].split("&")
        : [];
      let returnArr = {};
      tempArr.forEach((element) => {
        returnArr[element.split("=")[0]] = element.split("=")[1];
      });
      return returnArr;
    },
    getW_wd(){
        var _this = this;
    var _token = _this.getUrlData().token;
    if (_token) {
      sessionStorage.setItem("token", _token);
    } else if (
      sessionStorage.getItem("token") &&
      sessionStorage.getItem("token") != "undefined"
    ) {
      _token = sessionStorage.getItem("token");
    } else {
      _token = _this.getUrlData().token;
      sessionStorage.setItem("token", _token);
    }
    (function(w, d, s, q, i) {
      w[q] = w[q] || [];
      var f = d.getElementsByTagName(s)[0];
      var j = d.createElement(s);
      j.async = true;
      j.id = "beacon-aplus";
      j.src = "https://d.alicdn.com/alilog/mlog/aplus.js?id=202951085";
      f.parentNode.insertBefore(j, f);
    })(window, document, "script", "aplus_queue");
    // console.log("*正在获取用户信息，token:", _token);
    axios({
      url: "/api/user/info",
      method: "get",
      type: "json",
      header: { token: _token },
      data: { appCode: "ZFYYJC" },
    }).then((result) => {
      aplus_queue.push({
        action: "aplus.setMetaInfo",
        arguments: ["_hold", "BLOCK"],
      });
      // 设置用户名称
      aplus_queue.push({
        action: "aplus.setMetaInfo",
        arguments: ["_user_nick", result.aliasName],
      });
      // 设置用户ID
      aplus_queue.push({
        action: "aplus.setMetaInfo",
        arguments: ["_user_id", result.id],
      });
      // 如采集用户信息是异步行为，需要在设置完用户信息后执行这个START埋点
      // 此时被block住的日志会携带上用户信息逐条发出
      aplus_queue.push({
        action: "aplus.setMetaInfo",
        arguments: ["_hold", "START"],
      });
    });
    // 以下为设置元数据，aplus-rhost-v、aplus-rhost-g、appId、siteId等为固定值
    aplus_queue.push({
      action: "aplus.setMetaInfo",
      //    user
    });
    aplus_queue.push({
      action: "aplus.setMetaInfo",
      arguments: ["aplus-rhost-v", "alog.zjzwfw.gov.cn"],
    });
    aplus_queue.push({
      action: "aplus.setMetaInfo",
      arguments: ["aplus-rhost-g", "alog.zjzwfw.gov.cn"],
    });
    aplus_queue.push({
      action: "aplus.setMetaInfo",
      arguments: ["appId", "86542103164110"],
    });
    // 设置设备类型
    aplus_queue.push({
      action: "aplus.setMetaInfo",
      arguments: ["_dev_id", "01"],
    });
    // 补充PV日志参数需进行如下埋点：
    aplus_queue.push({
      action: "aplus.setMetaInfo",
      arguments: ["aplus-waiting", "MAN"],
    });
    // 单页应用路由切换后 或 在异步获取到pv日志所需的参数后再执行sendPV：
    aplus_queue.push({
      action: "aplus.sendPV",
      arguments: [
        {
          is_auto: false,
        },
        {
          // 自定义PV参数key-value键值对（只能是这种平铺的json，不能做多层嵌套），如：
          task_code: "196230663594131456", //任务页放入
          task_name: "民生一卡通", //任务页放入
          page_name: "民生一卡通", //任务页放入
          site_id: "101",
          city_code: "330000",
          area_code: "330000000000",
        },
      ],
    });
    },
    tabClick(item,i){
        this.linkIndex=i
        this.$router.push(item.url)
        this.init()
    }
    
  },
  created(){
 this.init();
  },
  mounted() {
    this.init();
  },
};
</script>
